package cn.joker.springmyselfjoker.demos.web;

import cn.joker.springmyselfjoker.demos.web.result.JsonResult;
import cn.joker.springmyselfjoker.demos.web.result.ResultUtil;
import cn.joker.springmyselfjoker.demos.web.service.TruncateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author: jiawp
 * @date: 2024/9/2 14:29
 * @description:
 **/
@RestController
@RequestMapping("/api")
public class UserController {
    @Autowired TruncateService truncateService;

    @RequestMapping("/getTruncate")
    public JsonResult getTruncate(@RequestParam String q, @RequestParam String to) {
        return ResultUtil.success(truncateService.getTruncate(q, to));
    }
}
